﻿using FlowCanvas.Nodes;
using LogSystem;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using Yoozoo.Gameplay.Liberty;
using Yoozoo.Gameplay.Liberty.AI;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class PlayerBattleSettings : CallableActionNode<bool, float, bool, bool, int>
    {
        public override void Invoke(bool freeAimOpen, float keepBattleDuration, bool canMove = true, bool canChangeWeapon = true, int minHp = 0)
        {
            BlueprintUtils.SetPlayerFreeAimOpen(freeAimOpen);
            BlueprintUtils.SetPlayerKeepBattleDuration(keepBattleDuration);
            LibertyAIUtils.PlayerController.inputController.CanMove = canMove;
            LibertyAIUtils.PlayerController.inputController.CanChangeWeapon = canChangeWeapon;
            LibertyAIUtils.PlayerController.playerEntity.AIEntity.data.minHp = minHp;
        }
    }
}